import { createApp } from 'vue'
import App from '/src/App.vue'
import router from './router'

// import axios from 'axios'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// import qs from 'qs'
import VueAMap, {initAMapApiLoader} from '@vuemap/vue-amap';
import VueAMapLoca from '@vuemap/vue-amap-loca';
import VueAMapExtra from '@vuemap/vue-amap-extra';
import '@vuemap/vue-amap/dist/style.css'
// 导入store
import store from './store/index';
// 导入md5加密模块
import md5 from 'js-md5'


initAMapApiLoader({
  key: '9ac3e72b68d6e4f4c4e21c9d196efec8',
  securityJsCode: '7eea05230b25b9d7f5c7fea0075f67f3', // 新版key需要配合安全密钥使用
  plugins: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor',  "AMap.Driving", "AMap.DragRoute"],
  Loca:{
   version: '2.0.0'
  } // 如果需要使用loca组件库，需要加载Loca
})

const app = createApp(App)

// app.config.globalProperties.$qs = qs
// app.config.globalProperties.$axios = axios
app.config.globalProperties.$router = router
app.config.globalProperties.$md5 = md5

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.use(router)
app.use(VueAMap)
app.use(store)
app.mount('#app')


